package com.woniuxy.patrol.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.Date;
import lombok.Data;

/**
 * 巡更任务表
 * @TableName wcm_patrol_task
 */
@TableName(value ="wcm_patrol_task")
@Data
public class PatrolTask implements Serializable {
    /**
     * 任务ID
     */
    @TableId(type = IdType.AUTO) // 声明自增主键
    private Long taskId;

    /**
     * XXL-JOB任务ID
     */
    private Integer xxlJobId;

    /**
     * 计划ID
     */
    private Long planId;

    /**
     * 巡更计划名
     */
    private String planName;

    /**
     * 执行日期
     */
    private LocalDate taskDate;

    /**
     * 任务状态：0未开始，1进行中，2已完成，3已暂停,4已取消,5执行失败
     */
    private Integer taskStatus;

    /**
     * 社区id
     */
    private Long communityId;

    /**
     * 
     */
    private String communityName;

    /**
     * 计划开始时间
     */
    private LocalDateTime plannedStartTime;

    /**
     * 计划结束时间
     */
    private LocalDateTime plannedEndTime;

    /**
     * 实际开始时间
     */
    private LocalDateTime actualStartTime;

    /**
     * 实际完成时间
     */
    private LocalDateTime  actualEndTime;

    /**
     * 完成率
     */
    @TableField("completion_rate")
    private BigDecimal completionRate;

    /**
     * 关联的路线ID，逗号分隔
     */
    private String routeIds;

    /**
     * 执行员工id
     */
    private Long executorId;

    /**
     * 执行人员
     */
    private String executorName;

    /**
     * 
     */
    private String executorEmail;

    /**
     * 备注
     */
    private String remark;

    /**
     * 是否删除，0删除 1存在
     */
    private Integer isDelete;

    /**
     * 创建人
     */
    private String createBy;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 修改人
     */
    private String updateBy;

    /**
     * 修改时间
     */
    private LocalDateTime updateTime;
//    /**
//     * 计划开始时间（时分，如08:00）
//     */
//    @TableField("plan_start_time")
//    private LocalTime planStartTime; // 新增字段
//
//    /**
//     * 计划结束时间（时分，如18:00）
//     */
//    @TableField("plan_end_time")
//    private LocalTime planEndTime; // 新增字段

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PatrolTask other = (PatrolTask) that;
        return (this.getTaskId() == null ? other.getTaskId() == null : this.getTaskId().equals(other.getTaskId()))
            && (this.getXxlJobId() == null ? other.getXxlJobId() == null : this.getXxlJobId().equals(other.getXxlJobId()))
            && (this.getPlanId() == null ? other.getPlanId() == null : this.getPlanId().equals(other.getPlanId()))
            && (this.getPlanName() == null ? other.getPlanName() == null : this.getPlanName().equals(other.getPlanName()))
            && (this.getTaskDate() == null ? other.getTaskDate() == null : this.getTaskDate().equals(other.getTaskDate()))
            && (this.getTaskStatus() == null ? other.getTaskStatus() == null : this.getTaskStatus().equals(other.getTaskStatus()))
            && (this.getCommunityId() == null ? other.getCommunityId() == null : this.getCommunityId().equals(other.getCommunityId()))
            && (this.getCommunityName() == null ? other.getCommunityName() == null : this.getCommunityName().equals(other.getCommunityName()))
            && (this.getPlannedStartTime() == null ? other.getPlannedStartTime() == null : this.getPlannedStartTime().equals(other.getPlannedStartTime()))
            && (this.getPlannedEndTime() == null ? other.getPlannedEndTime() == null : this.getPlannedEndTime().equals(other.getPlannedEndTime()))
            && (this.getActualStartTime() == null ? other.getActualStartTime() == null : this.getActualStartTime().equals(other.getActualStartTime()))
            && (this.getActualEndTime() == null ? other.getActualEndTime() == null : this.getActualEndTime().equals(other.getActualEndTime()))
            && (this.getCompletionRate() == null ? other.getCompletionRate() == null : this.getCompletionRate().equals(other.getCompletionRate()))
            && (this.getRouteIds() == null ? other.getRouteIds() == null : this.getRouteIds().equals(other.getRouteIds()))
            && (this.getExecutorId() == null ? other.getExecutorId() == null : this.getExecutorId().equals(other.getExecutorId()))
            && (this.getExecutorName() == null ? other.getExecutorName() == null : this.getExecutorName().equals(other.getExecutorName()))
            && (this.getExecutorEmail() == null ? other.getExecutorEmail() == null : this.getExecutorEmail().equals(other.getExecutorEmail()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()))
            && (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateBy() == null ? other.getUpdateBy() == null : this.getUpdateBy().equals(other.getUpdateBy()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));

    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getTaskId() == null) ? 0 : getTaskId().hashCode());
        result = prime * result + ((getXxlJobId() == null) ? 0 : getXxlJobId().hashCode());
        result = prime * result + ((getPlanId() == null) ? 0 : getPlanId().hashCode());
        result = prime * result + ((getPlanName() == null) ? 0 : getPlanName().hashCode());
        result = prime * result + ((getTaskDate() == null) ? 0 : getTaskDate().hashCode());
        result = prime * result + ((getTaskStatus() == null) ? 0 : getTaskStatus().hashCode());
        result = prime * result + ((getCommunityId() == null) ? 0 : getCommunityId().hashCode());
        result = prime * result + ((getCommunityName() == null) ? 0 : getCommunityName().hashCode());
        result = prime * result + ((getPlannedStartTime() == null) ? 0 : getPlannedStartTime().hashCode());
        result = prime * result + ((getPlannedEndTime() == null) ? 0 : getPlannedEndTime().hashCode());
        result = prime * result + ((getActualStartTime() == null) ? 0 : getActualStartTime().hashCode());
        result = prime * result + ((getActualEndTime() == null) ? 0 : getActualEndTime().hashCode());
        result = prime * result + ((getCompletionRate() == null) ? 0 : getCompletionRate().hashCode());
        result = prime * result + ((getRouteIds() == null) ? 0 : getRouteIds().hashCode());
        result = prime * result + ((getExecutorId() == null) ? 0 : getExecutorId().hashCode());
        result = prime * result + ((getExecutorName() == null) ? 0 : getExecutorName().hashCode());
        result = prime * result + ((getExecutorEmail() == null) ? 0 : getExecutorEmail().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
        result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", taskId=").append(taskId);
        sb.append(", xxlJobId=").append(xxlJobId);
        sb.append(", planId=").append(planId);
        sb.append(", planName=").append(planName);
        sb.append(", taskDate=").append(taskDate);
        sb.append(", taskStatus=").append(taskStatus);
        sb.append(", communityId=").append(communityId);
        sb.append(", communityName=").append(communityName);
        sb.append(", plannedStartTime=").append(plannedStartTime);
        sb.append(", plannedEndTime=").append(plannedEndTime);
        sb.append(", actualStartTime=").append(actualStartTime);
        sb.append(", actualEndTime=").append(actualEndTime);
        sb.append(", completionRate=").append(completionRate);
        sb.append(", routeIds=").append(routeIds);
        sb.append(", executorId=").append(executorId);
        sb.append(", executorName=").append(executorName);
        sb.append(", executorEmail=").append(executorEmail);
        sb.append(", remark=").append(remark);
        sb.append(", isDelete=").append(isDelete);
        sb.append(", createBy=").append(createBy);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateBy=").append(updateBy);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}